﻿<dialogs:BaseMetroDialog
  x:Class="SoftTeach.View.Noten.MetroNoteDialog"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:softTeach="clr-namespace:SoftTeach"
  xmlns:noten="clr-namespace:SoftTeach.ViewModel.Noten"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
  mc:Ignorable="d" 
  Title="{Binding NoteTitel}" d:DesignWidth="991.045" d:DesignHeight="479.114">
  <dialogs:BaseMetroDialog.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatSlider.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Themes/Dialogs/BaseMetroDialog.xaml" />-->
        <ResourceDictionary >
          <ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="Notentypen">
            <ObjectDataProvider.MethodParameters>
              <x:Type TypeName="noten:Notentyp" />
            </ObjectDataProvider.MethodParameters>
          </ObjectDataProvider>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </dialogs:BaseMetroDialog.Resources>
  <Grid>
    <StackPanel>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <DatePicker Grid.Column="0" Width="180"
				x:Name="NoteGültigAmDate" 
				Margin="0,5"
				FontSize="24"
				HorizontalAlignment="Left"
				SelectedDate="{Binding CurrentNote.NoteDatum, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"/>
        <TextBox Grid.Column="1" Height="{Binding ActualHeight, ElementName=NoteGültigAmDate}" Style="{StaticResource MetroLabelStyle}" Margin="5" VerticalAlignment="Center" Text="{Binding CurrentNote.NoteBezeichnung}"/>
      </Grid>
      <UniformGrid Columns="4">
        <RadioButton Name="QualitätButton" Height="50" MinWidth="130" Style="{StaticResource MetroToggleRadioButton}" Content="Qualität" Checked="QualitätButton_OnChecked"/>
        <RadioButton Name="QuantitätButton" Height="50" MinWidth="130" Style="{StaticResource MetroToggleRadioButton}" Content="Quantität" Checked="QuantitätButton_OnChecked"/>
        <RadioButton Name="WeitereMündlichButton" Height="50" MinWidth="130" Style="{StaticResource MetroToggleRadioButton}" Content="Weitere" Checked="WeitereMündlichButton_OnChecked"/>
        <RadioButton Name="WeitereSchriftlichButton" Height="50" MinWidth="130" Style="{StaticResource MetroToggleRadioButton}" Content="Schriftlich" Checked="WeitereSchriftlichButton_OnChecked"/>
      </UniformGrid>
      <ListBox Margin="5"
				ItemsSource="{Binding Zensuren, Source={x:Static softTeach:App.MainViewModel}}"             
				BorderThickness="0"
				SelectedItem="{Binding CurrentNote.NoteZensur}"
				x:Name="ZensurtypListBox"
				ItemTemplate="{StaticResource MetroZensurtypView}"
        ItemContainerStyle="{StaticResource MetroSelectableListBoxItem}">
        <ListBox.ItemsPanel>
          <ItemsPanelTemplate>
            <WrapPanel Width="{Binding ActualWidth, ElementName=ZensurtypListBox}"/>
          </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
      </ListBox>
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Column="0" Margin="0,5,5,0" Style="{StaticResource MetroLabelStyle}" VerticalAlignment="Bottom">Gewichtung</Label>
        <Label Grid.Column="1" Margin="5,5,10,0" Style="{StaticResource MetroLabelStyle}" VerticalAlignment="Bottom" Content="{Binding ElementName=GewichtungsSlider, Path=Value}"/>
        <Slider Name="GewichtungsSlider"  Grid.Column="2" Margin="0,5" Style="{DynamicResource FlatSlider}"
				Value="{Binding CurrentNote.NoteWichtung}" 
				SmallChange="1" 
				TickPlacement="Both" 
				Minimum="1"
				Maximum="10"
				Height="40"
				Width="Auto"
				IsSnapToTickEnabled="True"/>
      </Grid>
      <Button Width="100" FontSize="20" Margin="10" Content="Fertig" Style="{DynamicResource AccentedSquareButtonStyle}" Click="FertigButtonOnClick"/>
    </StackPanel>
  </Grid>
</dialogs:BaseMetroDialog>
